//
//  ST_EngagementViewController.swift
//  btvideo
//
//  Created by mac on 2020/12/3.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SwiftyJSON
import Alamofire
import RealmSwift
import NIMSDK
import SwiftyUserDefaults


enum ST_EngagementSocketServiceStatus {
    case normal
    case connecting
    case sendingFirstActionCode
    case heartDancing
    case disconnected
}

////MARK: - ST_SuspendProcessorProtocol
//extension ST_EngagementViewController:ST_SuspendProcessorProtocol{
//
//    @objc func suspendAnimating() {
//
//    }
//
//    @objc func provideShareViewSuspendAnimateCompletion() -> UIView? {
//        return nil
//    }
//
//    @objc func recoverSuspended() {
//
//    }
//
//}








//MARK: - Other
func seconds_to_hours_minutes_seconds (seconds : Int) -> (hour:Int, minute:Int, second:Int) {
    return (hour:seconds / 3600, minute:(seconds % 3600) / 60, second:(seconds % 3600) % 60)
}

func seconds_to_hours_minutes_seconds_string(seconds:Int) -> String {
    
    let date = seconds_to_hours_minutes_seconds(seconds: seconds)
    
    let hours = date.hour
    
    let minutes = date.minute
    
    let seconds = date.second
    
    if hours > 0{
        return String(format: "%02d:%02d:%02d", hours,minutes,seconds)
    }else{
        return String(format: "%02d:%02d", minutes,seconds)
    }
}


func covert_query_string_to_j_s_o_n(str:String)->JSON{
    
    let sampleUrl = PH.getAppleCoinPriceApi + "?" + str
    
    guard let parameters = sampleUrl.url?.queryParameters else{
        
        return JSON.null
    }
    
    return  JSON(parameters)
}
